package link.gpt.service.impl;

import link.gpt.dao.QuestionDao;
import link.gpt.pojo.Question;
import link.gpt.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version V1.0A
 * @uthor gpt
 * @Project holiday_task
 * @Package link.gpt.service.impl
 * @Description: ${TODO}
 * @Date 2021/10/7 17:00
 */
@Service
public class QuestionServiceImpl implements QuestionService {

   @Autowired
   private QuestionDao questionDao;

   @Override
   public List<Question> findAll() {
      return questionDao.selectByExample(null);
   }

   @Override
   public int addQuestion(Question question) {
      return questionDao.insertSelective(question);
   }

   @Override
   public int updateQuestionAnsCount(Integer id) {
      return questionDao.updateQuestionAnsCount(id);
   }

}
